import type { ListResponse } from '@/types'
import type { ArticleDetail, ArticleReqParams, ChannelResponse } from '@/types/article'
import { http } from '@/utils/http'

/**
 * 获取文章列表
 */
export const getArticleListApi = (params: ArticleReqParams) => {
  return http.get<ListResponse<ArticleDetail>>('/v1_0/mp/articles', { params })
}
/**
 * 获取频道列表
 */
export const getChannelsApi = () => {
  return http.get<ChannelResponse>('/v1_0/channels')
}
/**
 * 删除文章
 */
export const deleteArticleApi = (id: string) => {
  return http.delete<null>(`/v1_0/mp/articles/${id}`)
}
